<template>
    <div @click="add">{{ count }}</div>
</template>
<script>
import { mapState } from 'vuex'
export default {
    name: "Count",
    data() {
        return {

        }
    },
    mounted() {
    },
    computed: mapState({
        count: (state) => state.foo.count
    }),
    methods: {
        add() {
            console.log('add')
            this.$store.commit('foo/inc')
        }
    },
}
</script>